package com.csdj.course.controller;


import com.csdj.course.service.CoursePriceService;
import com.csdj.course.utils.JSONResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("coursePrice")
@Slf4j
public class CoursePriceController {
	@Autowired
	private CoursePriceService coursePriceService;

	@GetMapping("selectAll")
	public JSONResult selectAll(){
		return JSONResult.ok(coursePriceService.selectAll());
	}

	@GetMapping("select")
	public JSONResult select(Integer courseId){
		return JSONResult.ok(coursePriceService.select(courseId));
	}

	@GetMapping("coursesAndPrice")
	public JSONResult getCoursesAndPrice(){
		return JSONResult.ok(coursePriceService.select());
	}

}
